import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString, IsEnum } from 'class-validator';
import { PaginationDto } from '../../../common/dto/pagination.dto';
import { UserActionType } from '../entities/user-log.entity';

export class QueryUserLogDto extends PaginationDto {
  @ApiPropertyOptional({
    description: '用户ID',
    example: '12345678-1234-1234-1234-123456789012',
  })
  @IsOptional()
  @IsString()
  userId?: string;

  @ApiPropertyOptional({
    description: '操作类型',
    enum: UserActionType,
    example: UserActionType.LOGIN,
  })
  @IsOptional()
  @IsEnum(UserActionType)
  actionType?: UserActionType;

  @ApiPropertyOptional({
    description: '接口名称',
    example: '用户登录',
  })
  @IsOptional()
  @IsString()
  apiName?: string;
}
